package hu.vpszd.entities.transaction;

import static org.junit.Assert.*
import hu.vpszd.entities.customer.CheckingAccount

import org.junit.Test

public class TransactionTest {

	@Test
	public void test() {
		CheckingAccount starter = new CheckingAccount(id:1, bankAccountNumber:"1234512341")
		CheckingAccount ender = new CheckingAccount(id:2, bankAccountNumber:"1234512342")
		
		Transaction t = new Transaction(sum: 43)
		starter.outgoingTransactions << t
		ender.incomingTransactions << t
		
		Transaction t2 = new Transaction(sum: 20)
		starter.outgoingTransactions << t2
		ender.incomingTransactions << t2
		
		Transaction t3 = new Transaction(sum: 10)
		ender.outgoingTransactions << t3
		starter.incomingTransactions << t3
		
		assert starter.balance == -53
		assert ender.balance == 53
	}

}
